package com.fish.start.animation.threads;

import com.fish.start.animation.AnimationSet;
import com.fish.start.animation.callback.AnimatonCallBack;
import com.fish.start.animation.views.FishView;

public class ProduceAnimationThread implements Runnable{
	
	private AnimationSet mAnimations;
	private AnimatonCallBack mAnimatonCallBack;
	private FishView mFishView;
	private boolean mStop = true;
	public ProduceAnimationThread(AnimationSet aAnimations,
			AnimatonCallBack aAnimatonCallBack,FishView aFishView) {
		this.mAnimations = aAnimations;
		mAnimatonCallBack = aAnimatonCallBack;
		mFishView = aFishView;
	}
	@Override
	public void run() {
		//while(!mStop){
			try{
				mAnimatonCallBack.produceAnimation(mAnimations);
				mAnimations.stopProduce();
				mStop = false;
			}catch(Exception e ){
				mStop = false;
				mFishView.handlerException(e);
			}
		//}
	}
}
